<template>
  <div>
    <h1>{{ count }}</h1>
    <button @click="compute('plus')">+</button>
    <button @click="compute('minus')">-</button>
  </div>
</template>

<script>
export default {
  name: 'Counter',
  data() {
    return {
      count: 0
    };
  },
  methods: {
    compute(field) {
      switch (field) {
        case 'plus':
          this.count++;
          break;
        case 'minus':
          this.count--;
          break;
        default:
          break;
      }
    }
  }
};
</script>

<style></style>
